<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<% String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";%>
<!DOCTYPE html>
<html>
    <head>
        <base href="<%=basePath%>">
        <style>
            span {
                color: red;
            }
        </style>
        <script src="/js/jquery.min.js"></script>
        <script>
            $(function () {
                $("#goback").click(function () {
                    window.history.back();
                });
            });
        </script>
    </head>
    <body>
        <jsp:include page="/admin/top.jsp"/>
        <form name="form" action="order/orderEdit" method="post">
            <div class="middle">
                <table class="zbox">
                    <tr>
                        <td width="10%">订单编号</td>
                        <td>
                            <input type="text" value="${order.orderid}" disabled>
                            <input name="orderid" type="hidden" value="${order.orderid}">
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">订单日期</td>
                        <td>
                            <%--<input type="text"placeholder="必填"required>--%>
                            <label>
                                <input type="date" name="orderdate" value="<fmt:formatDate value='${order.orderdate}' pattern='yyyy-MM-dd'/>" required/>
                            </label>
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">用户名</td>
                        <td>
                            <input name="userid" type="text" value="${order.userid}" placeholder="必填" required>
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">订单总数</td>
                        <td><input name="totalnum" type="text" value="${order.totalnum}" placeholder="必填" required>
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">订单价格</td>
                        <td><input name="totalamount" type="text" value="${order.totalamount}" placeholder="必填"
                                   required>
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">支付方式</td>
                        <td><input name="payment" type="text" value="${order.payment}" placeholder="必填" required>
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">订单快递</td>
                        <td><input name="deliver" type="text" value="${order.deliver}" placeholder="必填" required>
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">订单接收人</td>
                        <td><input name="receiver" type="text" value="${order.receiver}" placeholder="必填" required>
                            <span>*</span>
                        </td>
                    </tr>
                    <tr>
                        <td width="10%">联系地址</td>
                        <td><input name="address" type="text" value="${order.address}"></td>
                    </tr>

                    <tr>
                        <td width="10%">电话</td>
                        <td><input name="phone" type="tel" pattern="[0-9]{11}" value="${order.phone}"></td>
                    </tr>
                    <tr>
                        <td width="10%">邮编</td>
                        <td><input name="postcode" type="text" pattern="[0-9]{3,6}"
                                   value="${order.postcode}"></td>
                    </tr>
                    <tr>
                        <td width="10%">状态</td>
                        <td>
                            <select name="state">
                                <option value='1' ${'1' ==  order.state ? 'selected':''}>激活</option>
                                <option value='0' ${'0' ==  order.state ? 'selected':''}>未激活</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <input type="submit" value="更新">&nbsp;&nbsp;
                            <input type="reset" value="重置">&nbsp;&nbsp;
                            <input id="goback" type="button" value="返回">
                        </td>
                    </tr>
                </table>
            </div>
        </form>
        <jsp:include page="/admin/bottom.jsp"/>
    </body>
</html>